<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>

  <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
  <script src="https://unpkg.com/vuex@2.0.0/dist/vuex.js"></script>
</head>

<body>

  <div id="app">
    num:{{$store.state.abc.num}}
    <hr>
    <custom-list></custom-list>
  </div>

  <script type="text/template" id="list">
    <ul>
      <li v-for="item in $store.state.product.goodslist">
        {{item.name}}
      </li>
    </ul>
  </script>

  <script>


    Vue.component('custom-list', {
      template: `#list`
    })


    var cart = {
      state: {
        num: 333
      }
    }

    var product = {
      state: {
        goodslist: [{ id: 1, name: "apple" }, { id: 2, name: 'lenovo' }]
      }
    }

    var store = new Vuex.Store({
      modules: {
        abc: cart,
        product
      }
    })

    var vm = new Vue({
      el: "#app",
      store
    })
  </script>

</body>

</html>